/***********************************************************************
filename:   hgeBaseSample.h
created:    24/9/2004
author:     Paul D Turner
*************************************************************************/

#ifndef _hgeBaseSample_h_
#define _hgeBaseSample_h_

// forward declarations
class hgeApplication;

/*!
\brief
This is a base class that is intended to be used for all sample applications.
Here we take care of common things such the renderer selection and application
startup.
*/
class hgeBaseSample
{
public:
	hgeBaseSample();
	virtual ~hgeBaseSample();

	// Application entry point.
	int run();

	// Sample specific initialisation goes here.  This method is called by the application base object created
	// as part of the initialise call.
	virtual bool initialiseSample()  = 0;

	// Cleans up resources allocated in the initialiseSample call.
	virtual void cleanupSample() = 0;

protected:
	//Initialises the sample system, this includes asking the user for a render to use and
	//the subsequent creation of the required systems to support that renderer.
	virtual bool initialise();

	//Cleans up all resources allocated by the initialise call.
	virtual void cleanup();

	//Output a message to the user in some OS independant way.
	void outputExceptionMessage(const char* message) const;

	/*************************************************************************
	Data fields
	*************************************************************************/
	hgeApplication*   d_sampleApp;            //!< Pointer to the base application object.
};

#endif  // end of guard _hgeBaseSample_h_
